#ifndef TASKASSIGNMENT_H
#define TASKASSIGNMENT_H

#include "taskAssignment/task_ack.h"
#include "taskAssignment/task.h"
#include "properties.h"

class TaskAssignment{
    public:
        TaskAssignment(AgvManager agvs_info,MissionManager missions_info,
                       ChargerManager chargers_info,StorePlaceManger storeplaces_info);
        void mission_update(Mission mission);
        void new_mission_exec();
        void taskAckCallback(const taskAssignment::task_ack msg);
    private:
        ros::NodeHandle nh_;
        ros::NodeHandle nh_private_;
        ros::Subscriber mission_sub_;
        ros::Publisher task_pub_;
        boost::thread working_th_;
        AgvManager agvs_info_;
        MissionManager missions_info_;
        int main_status_ = 0;
        float electricity_th_;
        ChargerManager chargers_info_;
        StorePlaceManger storeplaces_info_;
        map<int,Mission> agv_mission_;              ///<AgvId和任务之间映射
};

#endif
